﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleData.ObjectModel;
using SimpleData.ObjectModel.Design;
using SimpleData.Data;
using Moq;

namespace SimpleData
{
	public static class ObjectModelRepositoryExtensions
	{

		public static MockBuilder<IObjectModelRepository> ObjectModelRepository( this IMockInit builder )
		{
			return new MockBuilder<IObjectModelRepository>();
		}

		public static MockBuilder<IObjectModelRepository> GetSchema( this MockBuilder<IObjectModelRepository> builder, Func<SchemaName, Schema> creator )
		{
			builder
				.Mock
				.Setup( repo => repo.GetSchema<ToEditFetchStrategy>( It.IsAny<SchemaName>() ) )
				.Returns( creator );
			return builder;
		}
	}
}
